package com.geekstudy.week9;


import com.geekstudy.entity.Order;
import com.geekstudy.entity.User;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class Week9DubboConsumerMain {

    static final Logger logger = LoggerFactory.getLogger(Week9DubboConsumerMain.class);

    public static void main(String[] args) {
        ConfigurableApplicationContext configurableApplicationContext = SpringApplication.run(Week9DubboConsumerMain.class, args);
        int beanCount = configurableApplicationContext.getBeanDefinitionCount();
        logger.info(" Dubbo Consumer beanCount:{} ", beanCount);


        DubboClientService dubboClientService = configurableApplicationContext.getBean(DubboClientService.class);
        User user1 = dubboClientService.queryUser(101);
        logger.info(" user1:{} ", user1);

        Order order1 = dubboClientService.queryOrder(101);
        logger.info(" order1:{} ", order1);


    }
}
